package com.huadragon.marathondao.dao.impl;





import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.huadragon.marathondao.base.BaseDao;
import com.huadragon.marathondao.dao.inter.INewsDao;
import com.huadragon.marathonentity.common.page.PagerModel;
import com.huadragon.marathonentity.servicedomain.NewsDomain;

@Repository
public class NewsDaoImpl implements INewsDao {
	@Autowired
	private BaseDao dao;

	public List<NewsDomain> SelectHotNewsList(NewsDomain newsDomain){
		return dao.selectList("News.SelectHotNewsList", newsDomain);
	}
	public PagerModel selectPageList(NewsDomain e) {
		return dao.selectPageList("RoleInfo.selectPageList",
				"RoleInfo.selectPageCount", e);
	}
	
	public NewsDomain selectById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	public List selectList(NewsDomain e) {
		return dao.selectList("RoleInfo.selectList", e);
	}

	public NewsDomain selectOne(NewsDomain e) {
		return (NewsDomain) dao.selectOne("News.selectOne", e);
	}

	public int delete(NewsDomain e) {
		return dao.delete("AccountInfo.delete", e);
	}

	public int update(NewsDomain e) {
		return dao.update("RoleInfo.update", e);
	}

	public int deletes(int[] ids) {
		NewsDomain e = new NewsDomain();
		for (int i = 0; i < ids.length; i++) {
			e.setId(ids[i]);
			delete(e);
		}
		return 0;
	}

	public int insert(NewsDomain e) {
		return dao.insert("News.insert", e);
	}

	public int deleteById(int id) {
		return dao.delete("AccountInfo.deleteById", id);
	}

	public int selectCount(NewsDomain e) {
		return dao.getCount("AccountInfo.selectCount", e);
	}

	public int insertList(List<NewsDomain> list) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	
}
